﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FeedBack {
    public class CompositStoryParser : IStoryParser {
        private IEnumerable<IStoryParser> parsers;

        public CompositStoryParser(IEnumerable<IStoryParser> parsers) {
            if (parsers == null) {
                this.parsers = new List<IStoryParser>();
            }
            else {
                this.parsers = parsers;
            }
        }

        public IEnumerable<Facebook.JsonObject> GetStories() {
            foreach (var parser in parsers) {
                foreach (var story in parser.GetStories()) {
                    yield return story;
                }
            }
        }
    }
}
